package vista;
import com.cloudgarden.layout.AnchorLayout;

import contoladores.CCategoria;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;

import javax.swing.*;



/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VCategoria extends javax.swing.JFrame {
	private JLabel jLblcod_categoria;
	private JLabel jLblcodigo;
	private JButton jButtonModificar;
	private JButton jButtonBuscar;
	private JButton jButtonCancelar;
	private JTextField jTxtcod;
	private JButton Salir;
	private JButton jButtonAgregar;
	private JTextField jTxtdescrip;
	private JLabel jLbldescripcion;
	private JLabel jLblDescripcion;
	private CCategoria categoria;

	
	public VCategoria(CCategoria categ) {
		super();
		initGUI();
		categoria = categ;
		
	}
	
	private void initGUI() {
		{
			getContentPane().setLayout(null);
			setTitle("Categoria");
			getContentPane().setForeground(new java.awt.Color(255,128,64));
		}
		{
			jLbldescripcion = new JLabel();
			getContentPane().add(jLbldescripcion, "North");
			FlowLayout jLbldescripcionLayout = new FlowLayout();
			jLbldescripcion.setText("Descripcion:");
			jLbldescripcion.setLayout(null);
			jLbldescripcion.setBounds(31, 85, 95, 15);
		}
		{
			jLblcodigo = new JLabel();
			getContentPane().add(jLblcodigo, "Center");
			FlowLayout jLblcodigoLayout = new FlowLayout();
			jLblcodigo.setText("Codigo:");
			jLblcodigo.setLayout(null);
			jLblcodigo.setBounds(31, 40, 180, 22);
		}
		{
			jTxtcod = new JTextField();
			getContentPane().add(jTxtcod, "West");
			jTxtcod.setBounds(122, 41, 102, 22);
		}
		{
			jTxtdescrip = new JTextField();
			getContentPane().add(jTxtdescrip, "West");
			jTxtdescrip.setBounds(121, 85, 238, 22);
		}
		{
			jButtonAgregar = new JButton();
			getContentPane().add(jButtonAgregar);
			jButtonAgregar.setText("Agregar");
			jButtonAgregar.setBounds(43, 155, 95, 22);
			jButtonAgregar.setActionCommand("Agregar");
		}
		{
			Salir = new JButton();
			getContentPane().add(Salir);
			Salir.setBounds(321, 212, 82, 22);
			Salir.setText("Salir");
			Salir.setActionCommand("Salir");
		}
		{
			jButtonCancelar = new JButton();
			getContentPane().add(jButtonCancelar);
			jButtonCancelar.setText("Limpiar");
			jButtonCancelar.setBounds(280, 155, 107, 22);
		}
		{
			jButtonBuscar = new JButton();
			getContentPane().add(jButtonBuscar);
			jButtonBuscar.setText("Buscar");
			jButtonBuscar.setBounds(241, 41, 89, 22);
			jButtonBuscar.setActionCommand("Buscar");
		}
		{
			jButtonModificar = new JButton();
			getContentPane().add(jButtonModificar);
			jButtonModificar.setText("Modificar");
			jButtonModificar.setBounds(162, 155, 100, 22);
			jButtonModificar.setActionCommand("Modificar");
		}
		{
			this.setSize(424, 289);
		}
		//categoria = new CCategoria();
		
	}
	
	public void limpiar(){
		jTxtcod.setText("");
		jTxtdescrip.setText("");
		jTxtcod.setEnabled(true);
	}
	
	public void addListener(ActionListener escuchador){
		jButtonAgregar.addActionListener(escuchador);
		Salir.addActionListener(escuchador);
		jButtonBuscar.addActionListener(escuchador);
		jButtonCancelar.addActionListener(escuchador);
		jButtonModificar.addActionListener(escuchador);
	}
	
	
	public  void setCod(String dato){
		jTxtcod.setText(dato);
		jTxtcod.setEnabled(false);
	}
	
	public void setDes(String dato)	
	{
		jTxtdescrip.setText(dato);
	}
	public  String getCod(){
		return  jTxtcod.getText();
	}
	
	public String getDes(){
		return jTxtdescrip.getText();
	}


}
